const request = require('../../utils/kzj.request.js');
/**
 * 每一个页面对应一个contoller
 */
class controllerMy {

  /**
   * 登录
   * @return {Promise}
   */
  //完成服务
  accountOrderSuccess(params){
    return request.post(`/api/order/accountOrderSuccess`,params).then(res =>res.data)
  }
  //获取预约记录列表
  getRecord(params) {
    return request.post('/api/goods/agree/accountPage',params).then(res =>res.data)
  }
  //获取我的详细信息
  getMyInfo(params){
    return request.post(`/api/account/myInformation`,params).then(res =>res.data)
  }
  //获取预约记录详情
  apponintmentDetail(params){
    return request.post(`/api/goods/agree/agreeDetail`,params).then(res => res.data)
  }

  //预约详情确认签到
  appointmentOk(params){
    return request.post(`/api/goods/agree/ok`,params).then(res => res.data)
  }

  //获取我的会员店
  myShop(params){
    return request.post(`/api/shop/selectMyConsumed`,params).then(res => res.data)
  }

  //获取我的收藏
  myCollect(params){
    return request.post(`/api/goods/collection/controllerGoodsPage`,params).then(res => res.data)
  }

  //取消收藏
  cancelCollect(params){
    return request.post('/api/goods/collection/controllerGoods',params).then(res =>res.data)
  }

  //获取我的好友
  getMyFriend(params){
    return request.post(`/api/account/myFriends`,params).then(res =>res.data)
  }

  //获取订单列表
  getOrderList(params){
    return request.post(`/api/order/accountPage`,params).then(res => res.data)
  }

  //取消订单
  cancelOrder(params){
    return request.post(`/api/order/cancelOrder`,params).then(res => res.data)
  }

  //根据订单号获取输入的评论
  getOrderComment(params){
    return request.post(`/api/comment/selectByOrderNo`,params).then(res => res.data)
  }

  //评论商品
  toCommentProduct(params){
    return request.post(`/api/comment/comment`,params).then(res =>res.data)
  }

  //获取订单详情
  getOrderDetail(params){
    return request.post(`/api/order/orderDetails`,params).then(res =>res.data)
  }

  //获取好友详情
  getFriendDetail(params){
    return request.post(`/api/transaction/listByFriends`,params).then(res => res.data)
  }
}
/**
 * 实例化对象
 */
let controller = new controllerMy();
/**
 * 暴露对象，无需每次都加函数名
 */
module.exports = {
  controller,controller
}